var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.npc_ChangeController(3004303, "oid=368226", 281, 124, 5, 277, 331, 0, false, 0, false);
            cm.npc_ChangeController(3004302, "oid=368227", 385, 124, 5, 335, 435, 0, false, 0, false);
            cm.npc_ChangeController(3004300, "oid=368228", 20, 124, 4, -30, 70, 1, false, 0, false);
            if (cm.isQuestFinished(37311)) {
                cm.dispose();
                return
            }
            cm.curNodeEventEnd(true);
            cm.eventSKill(0);
            cm.setInGameDirectionMode(true, false, true);
            cm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection2();
            cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            cm.setStandAloneMode(true);
            cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            cm.inGameDirectionEvent_AskAnswerTime(1200);
            cm.curNodeEventEnd(true)
        } else {
            if (status === a++) {
                cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 1000, 0);
                cm.inGameDirectionEvent_AskAnswerTime(1400)
            } else {
                if (status === a++) {
                    cm.sendNormalTalk_Bottom("#face2#好奇怪。没有发现师父的踪迹。", 37, 3004322, false, true);
                    cm.effect_Voice("Voice5.img/CH1/Elwyn/18", 128)
                } else {
                    if (status === a++) {
                        cm.sendNormalTalk_Bottom("#face3#啊，这空间正变得越来越不稳定！", 37, 3004323, true, true);
                        cm.effect_Voice("Voice5.img/CH1/Lily/23", 128)
                    } else {
                        if (status === a++) {
                            cm.eventSKill(0);
                            cm.setInGameDirectionMode(false, true, false);
                            cm.setStandAloneMode(false);
                            cm.forceCompleteQuest(37311);
                            cm.dispose()
                        }
                    }
                }
            }
        }
    }
};